class BootStrap {

    def init = { servletContext ->
      def adminRole = new ccfc.Role(authority: 'ROLE_ADMIN').save(flush: true)
      def userRole = new ccfc.Role(authority: 'ROLE_USER').save(flush: true)

      def testUser = new ccfc.User(username: 'wop', enabled: true, password: 'wop')
      testUser.save(flush: true)

      ccfc.UserRole.create testUser, adminRole, true

      assert ccfc.User.count() == 1
      assert ccfc.Role.count() == 2
      assert ccfc.UserRole.count() == 1    	
    }
    def destroy = {
    }
}
